<?php

use Illuminate\Database\Seeder;

class AdminSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        factory(\App\Admin::class,3)->create();
        $admin = \App\Admin::find(1);
        $admin->name = 'admin';
        $admin->nickname = '张国宝';
        $admin->save();
        \Spatie\Permission\Models\Role::create(['name' => 'master','title'=>'站长','guard_name'=>'admin']);
        $admin->syncRoles('master');
    }
}
